package com.java.exer_6;

public class PlayerProduct extends Product {
    //购买数量
    private int count;

    public PlayerProduct(Product product, int count) {
        super(product.getProId(), product.getName(), product.getMinPrice(), product.getMaxPrice());
        //记录当前商品的价格
        this.setNowPrice(product.getNowPrice());
        this.count = count;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    @Override
    public String toString() {
        return super.toString() + "   " + count;
    }

    /**
     * 获取此货物总价
     */
    public int getSumPrice() {
        return this.getNowPrice() * this.count;
    }
}
